package com.neutech.shop.mapper.impl;

import com.neutech.shop.entity.CartItem;
import com.neutech.shop.mapper.CartItemMapper;
import com.neutech.shop.mapper.CategoryMapper;
import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.support.SqlSessionDaoSupport;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author Neuedu-远哥
 * @version 1.0
 * @date 2021/10/21 9:35
 */
@Repository
public class CartItemMapperImpl extends SqlSessionDaoSupport implements CartItemMapper {
    @Resource
    @Override
    public void setSqlSessionFactory(SqlSessionFactory sqlSessionFactory) {
        super.setSqlSessionFactory(sqlSessionFactory);
    }
    @Override
    public void insert(CartItem cartItem) {
        getSqlSession().getMapper(CartItemMapper.class).insert(cartItem);
    }

    @Override
    public List<CartItem> selectAll() {
        return getSqlSession().getMapper(CartItemMapper.class).selectAll();
    }
}
